package dao.tables;

import java.sql.Date;
import java.util.ArrayList;

public class MEMBRE extends PERSONNE {

	private RESPONSABILITE	responsabilite	= new RESPONSABILITE();
	private INSTRUMENT[]	listInstrument	= new INSTRUMENT[0];
	private SPECIALITE[]	listSpecialite	= new SPECIALITE[0];
	private GROUPE[]		listGroupe		= new GROUPE[0];

	public MEMBRE() {
		super();
	}

	public MEMBRE(long id, String nom, String prenom, String civilite, Date dateDeNaissance,
		RESPONSABILITE responsabilite, INSTRUMENT[] listInstrument, SPECIALITE[] listSpecialite,
		GROUPE[] listGroupe) {
		super(id, nom, prenom, civilite, dateDeNaissance);
		this.setResponsabilite(responsabilite);
		this.setListInstrument(listInstrument);
		// this.setListSpecialite(listSpecialite);
		this.setListGroupe(listGroupe);
	}

	public MEMBRE(PERSONNE pers, RESPONSABILITE responsabilite, INSTRUMENT[] listInstrument,
		SPECIALITE[] listSpecialite, GROUPE[] listGroupe) {
		super(pers.getId(), pers.getNom(), pers.getPrenom(), pers.getCivilite(), pers
			.getDateDeNaissance());
		this.setResponsabilite(responsabilite);
		this.setListInstrument(listInstrument);
		// this.setListSpecialite(listSpecialite);
		this.setListGroupe(listGroupe);
	}

	@Override
	public String getValue() {
		return this.getNom();
	}

	// RESPONSABILITE
	public void setResponsabilite(RESPONSABILITE responsabilite) {
		this.responsabilite = responsabilite;
	}

	public RESPONSABILITE getResponsabilite() {
		return responsabilite;
	}

	// INSTRUMENT
	public INSTRUMENT[] getListInstrument() {
		return this.listInstrument;
	}

	public void setListInstrument(ArrayList<INSTRUMENT> list) {
		this.listInstrument = list.toArray(this.listInstrument);
	}

	public void setListInstrument(INSTRUMENT[] list) {
		this.listInstrument = list;
	}

	// SPECIALITE
	public SPECIALITE[] getListSpecialite() {
		return this.listSpecialite;
	}

	public void setListSpecialite(ArrayList<SPECIALITE> list) {
		this.listSpecialite = list.toArray(this.listSpecialite);
	}

	// public void setListSpecialite(SPECIALITE[] list) {
	// this.listSpecialite = list;
	// }

	// GROUPE
	public GROUPE[] getListGroupe() {
		return this.listGroupe;
	}

	public void setListGroupe(ArrayList<GROUPE> list) {
		this.listGroupe = list.toArray(this.listGroupe);
	}

	public void setListGroupe(GROUPE[] list) {
		this.listGroupe = list;
	}

	@Override
	public String toString() {
		String str = "PERSONNE {\n";
		str += "\tID : " + this.getId() + "\n";
		str += "\tNOM : " + this.getNom() + "\n";
		str += "\tPRENOM : " + this.getPrenom() + "\n";
		str += "\tCIVILITE : " + this.getCivilite() + "\n";
		str += "\tDATE DE NAISSANCE : " + this.getDateDeNaissance() + "\n";
		str += "\tRESPONSABILITE : " + this.getResponsabilite() + "\n";
		str += "\tINSTRUMENTS : " + this.getListInstrument() + "\n";
		str += "\tSPECIALITES : " + this.getListSpecialite() + "\n}\n";
		str += ".....................................................\n";
		return str;
	}
}
